package vim.meet.aspect;

import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class AfterReturningAdviceExample {
	
	@Pointcut("execution(* cn.freemethod.aspect.target.BeforeTarget.after(*))")
	private void after(){}
	
	@AfterReturning("after()")
	public void doAfterReturn()
	{
		System.out.println("in:"+AfterReturningAdviceExample.class.getName()+":doAfterReturn!");
	}
	
	@AfterReturning(pointcut="after()",returning="retVal")
	public void withReturn(Object retVal) {
		System.out.println("result:"+retVal);
		System.out.println("in:"+AfterReturningAdviceExample.class.getName()+":withReturn!");
	}

}
